/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package logica.cliente;

import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import logica.Logica;
import model.cliente.Cliente;
import model.cliente.ClienteDAO;

/**
 *
 * @author manelv8
 */
public class ListaCliente implements Logica {

    @Override
    public void executa(HttpServletRequest req, HttpServletResponse res) throws Exception {
        
        
        ClienteDAO dao = new ClienteDAO();
     
        List<Cliente> lista = dao.listar();
        
        
        req.setAttribute("lista", lista);
        RequestDispatcher rd = req.getRequestDispatcher("buscaCliente.jsp");
        rd.forward(req, res);
    }
    
}
